<?php

namespace addons\qingdong\model;

use addons\qingdong\model\Product;
use addons\qingdong\model\ProductPart;
use think\Model;

/**
 *合同业绩分成
 */
class ContractRatio extends Model
{
    // 表名,不含前缀
    protected $name = 'qingdong_contract_ratio';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    /**
     * 合同
     */
    public function contract(){
        return $this->belongsTo(Contract::class,'contract_id','id')->setEagerlyType(0);
    }

    //
    public function staff() {
        return $this->hasOne(Staff::class, 'id', 'staff_id')->field('id,name,img,department_id,post');
    }
}
